person = {}
person['name'] ='yulidong'
person['age'] =43
person['gender'] ='man'
print(person)
#update 修改
yulidong = {'name':'yulidong','age':32,'gender':'man','math':89,'language':90}
person.update(yulidong)
print(person)
#setdefault 存/取 字典中存在不修改，不存在的键值修改，只传建名 从字典中获取值 不存在返回None
person.setdefault('name','zhansan')
person.setdefault('brithday','9.15')
print(person.setdefault('brithday'))
print(person.setdefault('english'))
print(person)

#keys 获取当前字典中所有key
print('------keys---------')
keys = list(person.keys())
print(keys)
#values 获取当前字典中所有的value

print('------values-------')
values = list(person.values())
print(values)

new = zip(keys,values)
for keys,values in new :
    print(keys,values)

#get
name = person.get('name')
#字典中没有 设置default
say = person.get('say','hello word')
print(say)
#pop
print('-----------pop-------------')
keys = person.pop('name')
print(keys)
print(person)

#clear
#person.clear()
print(person)

#del
print('-------person------------')
#del person
#print(person)

# in not in

print('name' in person)
print(person.get('name'))

#popitem
print(person)
person.popitem()
print(person)



